﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hamaazan.Data;

namespace Hamaazan.Logic
{
    public class Figures
    {

        private static Figures m_Instance = null;
        private static object _synclock = new object();

        public static Figures Instance
        {
            get
            {
                lock (_synclock)
                {
                    if (m_Instance == null)
                    {
                        m_Instance = new Figures();
                    }
                }
                return m_Instance;
            }
        }

        public List<Figure> GetFigures(string term)
        {
        
            using ( HamaazanEntities db = new HamaazanEntities())
            {
            List<Figure> result = db.Figures.Where(o=>o.Name.Contains(term)).ToList();

            return result;

            }



        }

    }
}
